using System;

namespace TraitorAmongUs {
#if WINDOWS || XBOX
	static class Program {
		/// <summary>
		/// The main entry point for the application.
		/// </summary>
		static void Main(string[] args) {
			AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
			using(Engine game = new Engine()) {
				game.Run();
			}
		}

		static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e) {
			Exception ex = (Exception)e.ExceptionObject;
			Engine.WriteLog(string.Format("Unhandled Exception: {0}: {1}", ex.ToString(), ex.Message));
			System.Windows.Forms.MessageBox.Show(ex.Message, ex.ToString());
		}
	}
#endif
}

